import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const SceneMonitorMeta: IPublicTypeComponentMetadata = {
  componentName: 'SceneMonitor',
  title: '场景监控',
  category: '信息展示',
  group: '应急管理',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'SceneMonitor',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
    {
      name: 'className',
      propType: 'string',
    },
    {
      name: 'width',
      propType: 'number',
      description: '组件宽度'
    },
    {
      name: 'height',
      propType: 'number',
      description: '组件高度'
    },
    {
      name: 'cameras',
      propType: 'array',
      description: '监控摄像头列表'
    },
    {
      name: 'mainBackgroundImage',
      propType: 'string',
      description: '主监控区域背景图'
    },
    {
      name: 'cameraButtonBackground',
      propType: 'string',
      description: '摄像头按钮背景色'
    },
    {
      name: 'cameraButtonBorder',
      propType: 'string',
      description: '摄像头按钮边框色'
    },
    {
      name: 'cameraTextColor',
      propType: 'string',
      description: '摄像头文字颜色'
    },
    {
      name: 'signalIndicatorColor',
      propType: 'string',
      description: '信号指示器颜色'
    },
    {
      name: 'signalGlowColor',
      propType: 'string',
      description: '信号发光颜色'
    },
    {
      name: 'showSignalIndicator',
      propType: 'bool',
      description: '显示信号指示器'
    },
    {
      name: 'buttonSpacing',
      propType: 'number',
      description: '按钮间距'
    },
    {
      name: 'theme',
      propType: 'string',
      description: '主题'
    },
    {
      name: 'onCameraClick',
      propType: 'func',
      description: '摄像头点击事件'
    },
    {
      name: 'onMainAreaClick',
      propType: 'func',
      description: '主区域点击事件'
    },
    {
      name: 'onClick',
      propType: 'func',
      description: '点击事件'
    }
  ],
  configure: {
    props: [
      {
        name: 'mainBackgroundImage',
        title: { label: { type: 'i18n', 'en-US': 'mainBackgroundImage', 'zh-CN': '主背景图片' } },
        setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'http://localhost:8085/static/images/changjingjiankong/bz44.png' }
      },
      {
        name: 'cameraButtonBackground',
        title: { label: { type: 'i18n', 'en-US': 'cameraButtonBackground', 'zh-CN': '按钮背景色' } },
        setter: { componentName: 'ColorSetter', isRequired: false, initialValue: 'rgba(36,48,62,0.57)' }
      },
      {
        name: 'cameraButtonBorder',
        title: { label: { type: 'i18n', 'en-US': 'cameraButtonBorder', 'zh-CN': '按钮边框色' } },
        setter: { componentName: 'ColorSetter', isRequired: false, initialValue: '#266FA6' }
      },
      {
        name: 'cameraTextColor',
        title: { label: { type: 'i18n', 'en-US': 'cameraTextColor', 'zh-CN': '文字颜色' } },
        setter: { componentName: 'ColorSetter', isRequired: false, initialValue: 'rgba(255,255,255,0.9)' }
      },
      {
        name: 'showSignalIndicator',
        title: { label: { type: 'i18n', 'en-US': 'showSignalIndicator', 'zh-CN': '显示信号指示器' } },
        setter: { componentName: 'BoolSetter', isRequired: false, initialValue: true }
      },
      {
        name: 'buttonSpacing',
        title: { label: { type: 'i18n', 'en-US': 'buttonSpacing', 'zh-CN': '按钮间距' } },
        setter: { componentName: 'NumberSetter', isRequired: false, initialValue: 12 }
      }
    ],
    supports: {
      style: true
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '场景监控',
    screenshot: '',
    schema: {
      componentName: 'SceneMonitor',
      props: {
        width: 500,
        height: 272,
        cameras: [
          { id: '1', name: '监控1', isActive: true, hasSignal: true },
          { id: '2', name: '监控2', isActive: false, hasSignal: true },
          { id: '3', name: '监控3', isActive: false, hasSignal: false },
          { id: '4', name: '监控4', isActive: false, hasSignal: true }
        ],
        mainBackgroundImage: 'http://localhost:8085/static/images/changjingjiankong/bz44.png',
        cameraButtonBackground: 'rgba(36,48,62,0.57)',
        cameraButtonBorder: '#266FA6',
        cameraTextColor: 'rgba(255,255,255,0.9)',
        signalIndicatorColor: '#FFFFFF',
        signalGlowColor: '#0085FF',
        showSignalIndicator: true,
        buttonSpacing: 12,
        theme: 'dark'
      }
    }
  }
];

export default {
  ...SceneMonitorMeta,
  snippets
};
